#!C:\Perl\bin\perl.exe
 
 use strict;
 use CGI::Carp qw(fatalsToBrowser);
 use HTML::ReportWriter;
 use CGI;
 use Template;
 use DBI;

 my $connect2db = sub{ return DBI->connect_cached( "DBI:mysql:database=als_pm;host=10.205.0.16;port=3306", "siae", "" ) or die $DBI::errstr };

 my $report = HTML::ReportWriter->new({
                DBH =>$connect2db->(),
                DEFAULT_SORT => 'Name',
                PAGE_TITLE => 'ALS current status report.',
                HTML_FOOTER => sprintf("<center><div id=footer>%s</div></center>", scalar localtime),
                SQL_FRAGMENT => 'from als_branch left join als_host using(ip)',
                COLUMNS => [ qw{ ip Name
                                 BranchName
                                 AtpcManual
                                 RxActiveStatus RxMin Prx RxMax
                                 TxActiveStatus PtxSetValue TxMin Ptx TxMax
                                 BaseBandErr UAS BBE SES ES OOFS SEP
                                 updated  } ],
 });

 $report->draw();

 # excluded COLUMNS: branchid description  BaseBandMantBer  description monitored  TxStatus   Tlts4 RxBlockStatus Tlts2 Rlts1 Tlts1 Rlts4 Tlts3 Rlts3  Rlts2  TxBlockStatus  pmG826BlockStatus community
